{include file="base/header" /}
{include file="base/menu" /}


<div class="admin-biaogelist">

    <div class="listbiaoti am-cf">
      <ul class="am-icon-flag on">活动</ul>

      <dl class="am-icon-home" style="float: right;"> 当前位置： 首页 > <a href="#">活动列表</a></dl>

      <dl>
        <a  href="{:url('activity/release')}" class="am-btn am-btn-danger am-round am-btn-xs am-icon-plus">发布</a>
      </dl>


    </div>

	<div class="am-btn-toolbars am-btn-toolbar am-kg am-cf">
  <ul>

    <li style="margin-right: 0;">
    	<span class="tubiao am-icon-calendar"></span>
      <input type="text" class="am-form-field am-input-sm am-input-zm  am-icon-calendar" id="beginTime" name="beginTime" value="{$searchInfo.beginTime}" placeholder="开始日期" data-am-datepicker="{theme: 'success',}"  readonly/>
    </li>
       <li style="margin-left: -4px;">
    	<span class="tubiao am-icon-calendar"></span>
      <input type="text" class="am-form-field am-input-sm am-input-zm  am-icon-calendar" id="endTime" name="endTime" value="{$searchInfo.endTime}" placeholder="结束日期" data-am-datepicker="{theme: 'success',}"  readonly/>
    </li>

        <li style="margin-left: -10px;">
      <div class="am-btn-group am-btn-group-xs">
      <select data-am-selected="{btnWidth: 90, btnSize: 'sm', btnStyle: 'default'}" id="type">
        <option value="0">活动类型</option>
        {volist name="activityType" id="vo"}
        <option value="{$vo.id}">{$vo.activityName}</option>
         {/volist}
      </select>
      </div>
    </li>
    <li><input type="text" class="am-form-field am-input-sm am-input-xm" id="searchKey" name="searchKey" value="{$searchInfo.searchKey}" placeholder="关键词搜索" /></li>
    <li><button type="button" onClick="goSearch()" class="am-btn am-radius am-btn-xs am-btn-success" style="margin-top: -1px;">搜索</button></li>
  </ul>
</div>


    <form class="am-form am-g">
          <table width="100%" class="am-table am-table-bordered am-table-radius am-table-striped" id="activityList">
            <thead>
              <tr class="am-success">
                <th class="table-check"><input type="checkbox" /></th>
                <!--   <th class="table-id">排序</th>-->

                <!-- <th class="table-id">流水号</th> -->
                <th class="table-title">标题</th>
                <th class="table-type">活动类型</th>
                <th class="table-author am-hide-sm-only">状态</th>
                <th class="table-date am-hide-sm-only">发布时间</th>
                <th class="table-title">浏览数</th>
                <th width="163px" class="table-set">操作</th>
              </tr>
            </thead>
            <tbody>
              <tr>
                {volist name="list.activityList" id="vlist"}
                <td><input type="checkbox" id="$vlist.activityId"/></td>
                <td><a href="http://www.youhuer.com/index.php?s=/Mob/Enterprise/activityDetails/activityId/{$vlist.activityId}">{$vlist.Title}</a></td>
                <td>{$vlist.activityName}</td>
                <td class="am-hide-sm-only">

                {eq name="vlist.status" value="1"}
                <i class="am-icon-check am-text-warning"></i>
                {else/}
                <i class="am-icon-close am-text-primary"></i>
                 {/eq}
                </td>
                <td class="am-hide-sm-only">{$vlist.releaseTime}</td>
                <td>{$vlist.appBrowseCount}</td>
                <td><div class="am-btn-toolbar">
                    <div class="am-btn-group am-btn-group-xs">
                      <a href="http://www.youhuer.com/index.php?s=/Mob/Enterprise/activityDetails/activityId/{$vlist.activityId}" target="_blank" class="am-btn am-btn-default am-btn-xs am-text-success am-round"><span class="am-icon-search"></span> </a>
                      <button class="am-btn am-btn-default am-btn-xs am-text-secondary am-round"><span class="am-icon-pencil-square-o"></span></button>
                      <button type="button" activityId="{$vlist.activityId}" class="delete am-btn am-btn-default am-btn-xs am-text-danger am-round"><span class="am-icon-trash-o"></span></button>
                    </div>
                  </div>



                  </td>
              </tr>
              {/volist}

            </tbody>
          </table>
             <!--
                 <div class="am-btn-group am-btn-group-xs">
              <button type="button" class="am-btn am-btn-default"><span class="am-icon-save"></span> 上架</button>
              <button type="button" class="am-btn am-btn-default"><span class="am-icon-save"></span> 下架</button>
              <button type="button" class="am-btn am-btn-default"><span class="am-icon-save"></span> 移动</button>
              <button type="button" class="am-btn am-btn-default"><span class="am-icon-plus"></span> 新增</button>
              <button type="button" class="am-btn am-btn-default"><span class="am-icon-save"></span> 保存</button>
              <button type="button" class="am-btn am-btn-default"><span class="am-icon-archive"></span> 移动</button>
              <button type="button" class="am-btn am-btn-default"><span class="am-icon-trash-o"></span> 删除</button>
            </div>
             -->
          <ul class="am-pagination am-fr">
                {eq name="list.currentPage" value="1"}
                <li class="am-disabled"><a href="{:url('activity/halllist')}">«</a></li>
                {else/}
                <li><a href="{:url('activity/halllist',array('page'=>1,'searchKey'=>$searchInfo.searchKey,'beginTime'=>$searchInfo.beginTime,'endTime'=>$searchInfo.endTime,'type'=>$searchInfo.type))}">«</a></li>
                {/eq}
                {volist name="list.pageArray" id="pageList"}
                {if condition="($pageList.id == $list.currentPage)"}
                <li class="am-active"><a href="{:url('activity/halllist',array('page'=>$pageList.id,'beginTime'=>$searchInfo.beginTime,'searchKey'=>$searchInfo.searchKey,'endTime'=>$searchInfo.endTime,'type'=>$searchInfo.type))}">{$pageList.id}</a></li>
               {else /}
                <li><a href="{:url('activity/halllist',array('page'=>$pageList.id,'beginTime'=>$searchInfo.beginTime,'searchKey'=>$searchInfo.searchKey,'endTime'=>$searchInfo.endTime,'type'=>$searchInfo.type))}">{$pageList.id}</a></li>
                {/if}
                {/volist}

                <li><a href="{:url('activity/halllist',array('page'=>$list.totalPage,'beginTime'=>$searchInfo.beginTime,'searchKey'=>$searchInfo.searchKey,'endTime'=>$searchInfo.endTime,'type'=>$searchInfo.type))}">»</a></li>
              </ul>




          <hr/>
        </form>
  <script>
 function goSearch()
 {
 var beginTime = document.getElementById("beginTime").value;
 var endTime = document.getElementById("endTime").value;
 var type = document.getElementById("type").value;
 var searchKey = document.getElementById("searchKey").value;
 var url = "{:url('activity/halllist')}".replace('.html','');
 if(beginTime!='')
 {
 url = url+'/beginTime/'+beginTime;
 }
 if(endTime!='')
 {
 url = url+'/endTime/'+endTime;
 }
 if(type!='')
 {
  url = url+'/type/'+type;
 }
  if(searchKey!='')
 {
  url = url+'/searchKey/'+searchKey;
 }
   window.location.href=url;
 }
 function autoDefaultSelect()
 {
 document.getElementById('type').value= "{$searchInfo.type}";
 }
 autoDefaultSelect();
  </script>

 <script>
   $("#activityList").delegate(".delete", 'click', function () {
   activityId = $(this).attr("activityId");
   url="{:url('activity/del')}";
    $.post(url, {activityId:activityId}, function (msg) {
               if(msg.status==0)
               {
                parent.location.reload();
               }else
               {
               alert('操作失败!');
               }

            }, 'json');



});

 </script>

 {include file="base/footer" /}